package com.baseframe.blog.mapper;

import com.baseframe.blog.entity.SnsBlogComment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baseframe.blog.entity.request.SnsBlogCommentRequest;
import com.baseframe.blog.entity.vo.SnsBlogCommentVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**

* @description 针对表【sns_blog_comment(博客点赞表)】的数据库操作Mapper
* @createDate 2023-06-23 17:55:58
* @Entity com.baseframe.blog.entity.SnsBlogComment
*/
public interface SnsBlogCommentMapper extends BaseMapper<SnsBlogComment> {

    @Select("select sbc.*,bu.username,bu.nickname from sns_blog_comment as sbc left join base_user as bu on sbc.user_id = bu.id where bu.is_deleted = 0 and sbc.blog_id = #{request.blogId} order by sbc.create_time desc")
    List<SnsBlogCommentVO> getCommentAllInfoList(@Param("request") SnsBlogCommentRequest request);
}




